package com.coocaa.internship.service.serviceImpl;

import com.coocaa.internship.common.ResultData;
import com.coocaa.internship.dao.ProvinceDao;
import com.coocaa.internship.pojo.Province;
import com.coocaa.internship.service.ProvinceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Description: 省份信息查询业务实现类
 * @Author: zwh
 * @Date: 2019-07-30
 * @Time: 23:03
 */
@Service
public class ProvinceServiceImpl implements ProvinceService {

    @Autowired
    ProvinceDao provinceDao;

    @Override
    public ResultData selectAllProvinces() {
        List<Province> provinces = provinceDao.selectAllProvinces();
        if (!provinces.isEmpty()) {
            return ResultData.success(provinces);
        }
        return ResultData.failed();
    }
}
